/**
 * @file   1092.cpp
 * @author Shuang Hu <hsmath@ubuntu>
 * @date   Sun Apr 18 23:06:52 2021
 * 
 * @brief  PAT Problem 1092,find chars by container map!
 * 
 * 
 */
#include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
    string s1,s2;
    getline(cin,s1);
    getline(cin,s2);
    map<char,int> m1,m2;
    for(int i=0;i<s1.size();i++){
	m1[s1[i]]++;
    }
    for(int i=0;i<s2.size();i++){
	m2[s2[i]]++;
    }
    bool buyornot=true;
    int extra=0;
    int notenough=0;
    for(auto it=m2.begin();it!=m2.end();it++){
//	cout<<it->first<<" "<<m1[it->first]<<endl;
	if(it->second>m1[it->first]){
	    notenough=notenough-m1[it->first]+it->second;
	    buyornot=false;
	}
    }
    if(buyornot==true){
	extra=s1.length()-s2.length();
	cout<<"Yes "<<extra<<endl;
    }else{
	cout<<"No "<<notenough<<endl;
    }
}
